<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="controller.CountOrder"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'orderCount.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<script type="text/javascript"> 
		window.onload=function(){ 
		//设置年份的选择 
		var myDate= new Date(); 
		var startYear=myDate.getFullYear()-10;//起始年份 
		var endYear=myDate.getFullYear();//结束年份 
		var obj=document.getElementById('myYear') 
		for (var i=startYear;i<=endYear;i++) 
		{ 
		obj.options.add(new Option(i,i)); 
		} 
		obj.options[obj.options.length-1].selected=1; 

		var startMonth=1;
		var endMonth=12;
		var obj=document.getElementById('myMonth');
		for (var i=startMonth;i<=endMonth;i++) 
		{ 
		obj.options.add(new Option(i,i)); 
		} 
		obj.options.add(new Option("--",i));
		obj.options[obj.options.length-1].selected=1; 
		} 

	</script> 
  </head>
  
  <body style="background-image:url('images/0300.gif'); ">
  
  <div id="head" style="border:1px solid #c3c3c3;float:left;">
		<form action=" CountOrder.action" method="post">
			请选择年份：<select id="myYear" name ="year"></select>&nbsp;&nbsp;
			月份: <select id="myMonth" name ="month"></select>&nbsp;&nbsp;
			<input type="submit" value="查询" />
		</form>
	</div>
	<br/>
	<br/>
     <h4>订单统计表</h4>
         <div class="table-responsive">
        
         	<table border="1" cellpadding="5" cellspacing="3" class="table table-hover">
			   <tr>
			   	   <td>年份</td>
				   <td>月份</td>
				   <td>订单数量</td>
				   <td>订单金额</td>
			   </tr>
			   
			   <%
  	 			//CountOrder countorder=new CountOrder();
 
   				List list1=CountOrder.list;
   				Iterator it=list1.iterator();
				while(it.hasNext()){
					Object[] o=(Object[]) it.next();
					System.out.println(o[2]);%>
         
         		 <tr>
         			 <td><%= o[2]%></td>
             		 <td><%= o[3]%></td>
           		 	 <td><%= o[0]%></td>
              		 <td><%= o[1]%></td>       
          		</tr>       
          		 
    			 <% System.out.println("aaaa"); } %>
       		</table>
       		
       
     
         </div>   
         
    <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="js/jquery.ui.touch-punch.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootstrap-select.js"></script>
    <script src="js/bootstrap-switch.js"></script>
    <script src="js/flatui-checkbox.js"></script>
    <script src="js/flatui-radio.js"></script>
    <script src="js/jquery.tagsinput.js"></script>
    <script src="js/jquery.placeholder.js"></script>  
  </body>
</html>
